<% Puppetclass.classes2hash(puppetclasses).sort.in_groups(2,nil) do |group| %>
  <div class="col-md-6 classes">
    <% group.each do |list| %>
      <% next if list.nil? %>
      <ul class="puppetclass_group">
        <li><%= puppetclass_group_with_icon(list, selected_puppet_classes) %>
          <ul id="pc_<%= list.first %>" style="display: none;">
            <% for klass in list.last.sort %>
              <% unless authorized_for(:controller => :host_editing, :action => :edit_classes) %>
                <li data-original-title="<%= _('Not authorized to edit classes') %>" rel="twipsy"><%= h klass.name %></li>
              <% else %>
                <% style = selected_puppet_classes.include?(klass) ? "hide" : "" %>
                <%= content_tag_for :li, klass, :class=> style do %>
                  <%= link_to_add_puppetclass(klass, type) %>
                <% end %>
              <% end %>
            <% end %>
          </ul>
        </li>
      </ul>
    <% end %>
  </div>
<% end %>
